﻿#encoding: utf-8
from weiaadao.models import *
def insert_all_data():
#def insert_all_WeiaaUser():
	#inset data
	woniu17 = WeiaaUser(passwd = '123',name = 'woniu17',email = 'woniu17@weiaa.cn',phone_num = '123456789123',permission=0,weibo_id = '12345',access_token = 'Raaaa',expire_in = 123456)
	woniu17.save()
	etaf = WeiaaUser(passwd = '123',name = 'etaf',email = 'etaf@weiaa.cn',phone_num = '123456789456',permission=0,weibo_id = '54321',access_token = 'Raaaa',expire_in = 123456)
	etaf.save()
#def insert_all_WeiaaActivity():
	#state 0:unchecked; 1:check; 2:feeing: 3:finished
	activity01 = WeiaaActivity(name = 'activity01',date = '2013-12-19 12:00',state = 0,creator_id = woniu17)
	activity02 = WeiaaActivity(name = 'activity02',date = '2013-12-26 12:00',state = 0,creator_id = etaf)
	activity03 = WeiaaActivity(name = 'activity03',date = '2013-11-27 12:00',state = 1,creator_id = woniu17)
	activity04 = WeiaaActivity(name = 'activity04',date = '2013-11-06 12:00',state = 2,creator_id = etaf)
	activity05 = WeiaaActivity(name = 'activity05',date = '2013-10-06 12:00',state = 3,creator_id = woniu17)
	activity06 = WeiaaActivity(name = 'activity06',date = '2013-11-05 12:00',state = 3,creator_id = etaf)
	activity01.save()
	activity02.save()
	activity03.save()
	activity04.save()
	activity05.save()
	activity06.save()
#def insert_all_WeiaaActivityPlan():
	plan01 = WeiaaActivityPlan(aid = activity01, is_selected = False, vote = 0,estimate_per_cost = 100, real_cost = 500, creator_id = woniu17)
	plan02 = WeiaaActivityPlan(aid = activity01, is_selected = False, vote = 0,estimate_per_cost = 90, real_cost = 600, creator_id = etaf)
	plan03 = WeiaaActivityPlan(aid = activity02, is_selected = False, vote = 0,estimate_per_cost = 100, real_cost = 500, creator_id = woniu17)
	plan04 = WeiaaActivityPlan(aid = activity02, is_selected = False, vote = 0,estimate_per_cost = 90, real_cost = 600, creator_id = etaf)
	plan05 = WeiaaActivityPlan(aid = activity03, is_selected = True, vote = 0,estimate_per_cost = 100, real_cost = 500, creator_id = woniu17)
	plan06 = WeiaaActivityPlan(aid = activity03, is_selected = False, vote = 0,estimate_per_cost = 90, real_cost = 600, creator_id = etaf)
	plan07 = WeiaaActivityPlan(aid = activity04, is_selected = False, vote = 0,estimate_per_cost = 100, real_cost = 500, creator_id = woniu17)
	plan08 = WeiaaActivityPlan(aid = activity04, is_selected = True, vote = 0,estimate_per_cost = 90, real_cost = 600, creator_id = etaf)
	plan09 = WeiaaActivityPlan(aid = activity05, is_selected = False, vote = 0,estimate_per_cost = 100, real_cost = 500, creator_id = woniu17)
	plan0a = WeiaaActivityPlan(aid = activity05, is_selected = True, vote = 0,estimate_per_cost = 90, real_cost = 600, creator_id = etaf)
	plan0b = WeiaaActivityPlan(aid = activity06, is_selected = True, vote = 0,estimate_per_cost = 100, real_cost = 500, creator_id = woniu17)
	plan0c = WeiaaActivityPlan(aid = activity06, is_selected = False, vote = 0,estimate_per_cost = 90, real_cost = 600, creator_id = etaf)
	plan01.save()
	plan02.save()
	plan03.save()
	plan04.save()
	plan05.save()
	plan06.save()
	plan07.save()
	plan08.save()
	plan09.save()
	plan0a.save()
	plan0b.save()
	plan0c.save()
#def insert_all_WeiaaActivityPlanItem():
	item01 = WeiaaActivityPlanItem(apid = plan01, start_time = '2013-12-19 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item02 = WeiaaActivityPlanItem(apid = plan01, start_time = '2013-12-19 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item03 = WeiaaActivityPlanItem(apid = plan02, start_time = '2013-12-19 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item04 = WeiaaActivityPlanItem(apid = plan02, start_time = '2013-12-19 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item05 = WeiaaActivityPlanItem(apid = plan03, start_time = '2013-12-26 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item06 = WeiaaActivityPlanItem(apid = plan03, start_time = '2013-12-26 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item07 = WeiaaActivityPlanItem(apid = plan04, start_time = '2013-12-26 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item08 = WeiaaActivityPlanItem(apid = plan04, start_time = '2013-12-26 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item09 = WeiaaActivityPlanItem(apid = plan05, start_time = '2013-11-27 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0a = WeiaaActivityPlanItem(apid = plan05, start_time = '2013-11-27 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0b = WeiaaActivityPlanItem(apid = plan06, start_time = '2013-11-27 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0c = WeiaaActivityPlanItem(apid = plan06, start_time = '2013-11-27 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0d = WeiaaActivityPlanItem(apid = plan07, start_time = '2013-12-06 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0e = WeiaaActivityPlanItem(apid = plan07, start_time = '2013-12-06 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0f = WeiaaActivityPlanItem(apid = plan08, start_time = '2013-12-06 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0g = WeiaaActivityPlanItem(apid = plan08, start_time = '2013-12-06 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0h = WeiaaActivityPlanItem(apid = plan09, start_time = '2013-10-06 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0i = WeiaaActivityPlanItem(apid = plan09, start_time = '2013-10-06 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0j = WeiaaActivityPlanItem(apid = plan0a, start_time = '2013-10-06 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0k = WeiaaActivityPlanItem(apid = plan0a, start_time = '2013-10-06 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0l = WeiaaActivityPlanItem(apid = plan0b, start_time = '2013-11-05 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0m = WeiaaActivityPlanItem(apid = plan0b, start_time = '2013-11-05 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item0n = WeiaaActivityPlanItem(apid = plan0c, start_time = '2013-11-05 12:00', place = '大丰收鱼庄宝龙店', content = '大丰收吃鱼', estimate_per_cost = 50.0, real_cost = 150)
	item0o = WeiaaActivityPlanItem(apid = plan0c, start_time = '2013-11-05 14:00', place = 'agogo万象店', content = 'agogo唱歌', estimate_per_cost = 40.0, real_cost = 150)
	item01.save()
	item02.save()
	item03.save()
	item04.save()
	item05.save()
	item06.save()
	item07.save()
	item08.save()
	item09.save()
	item0a.save()
	item0b.save()
	item0c.save()
	item0d.save()
	item0e.save()
	item0f.save()
	item0g.save()
	item0h.save()
	item0i.save()
	item0j.save()
	item0k.save()
	item0l.save()
	item0m.save()
	item0n.save()
	item0o.save()
#def insert_all_WeiaaActivityMember():
	member01 = WeiaaActivityMember(aid = activity01, uid = woniu17, real_per_cost = 150, is_paid = False)
	member02 = WeiaaActivityMember(aid = activity01, uid = etaf, real_per_cost = 150, is_paid = False)
	member03 = WeiaaActivityMember(aid = activity02, uid = woniu17, real_per_cost = 150, is_paid = False)
	member04 = WeiaaActivityMember(aid = activity02, uid = etaf, real_per_cost = 150, is_paid = False)
	member05 = WeiaaActivityMember(aid = activity03, uid = woniu17, real_per_cost = 150, is_paid = False)
	member06 = WeiaaActivityMember(aid = activity03, uid = etaf, real_per_cost = 150, is_paid = False)
	member07 = WeiaaActivityMember(aid = activity04, uid = woniu17, real_per_cost = 150, is_paid = True)
	member08 = WeiaaActivityMember(aid = activity04, uid = etaf, real_per_cost = 150, is_paid = False)
	member09 = WeiaaActivityMember(aid = activity05, uid = woniu17, real_per_cost = 150, is_paid = True)
	member0a = WeiaaActivityMember(aid = activity05, uid = etaf, real_per_cost = 150, is_paid = True)
	member0b = WeiaaActivityMember(aid = activity06, uid = woniu17, real_per_cost = 150, is_paid = True)
	member0c = WeiaaActivityMember(aid = activity06, uid = etaf, real_per_cost = 150, is_paid = True)
	member01.save()
	member02.save()
	member03.save()
	member04.save()
	member05.save()
	member06.save()
	member07.save()
	member08.save()
	member09.save()
	member0a.save()
	member0b.save()
	member0c.save()
#def insert_all_WeiaaActivityPlanVote():
	vote01 = WeiaaActivityPlanVote(apid = plan01, uid = woniu17)
	vote02 = WeiaaActivityPlanVote(apid = plan01, uid = etaf)
	vote03 = WeiaaActivityPlanVote(apid = plan03, uid = woniu17)
	vote04 = WeiaaActivityPlanVote(apid = plan03, uid = etaf)
	vote05 = WeiaaActivityPlanVote(apid = plan05, uid = woniu17)
	vote06 = WeiaaActivityPlanVote(apid = plan05, uid = etaf)
	vote07 = WeiaaActivityPlanVote(apid = plan07, uid = woniu17)
	vote08 = WeiaaActivityPlanVote(apid = plan07, uid = etaf)
	vote09 = WeiaaActivityPlanVote(apid = plan09, uid = woniu17)
	vote0a = WeiaaActivityPlanVote(apid = plan09, uid = etaf)
	vote0b = WeiaaActivityPlanVote(apid = plan0b, uid = woniu17)
	vote0c = WeiaaActivityPlanVote(apid = plan0b, uid = etaf)
	vote01.save()
	vote02.save()
	vote03.save()
	vote04.save()
	vote05.save()
	vote06.save()
	vote07.save()
	vote08.save()
	vote09.save()
	vote0a.save()
	vote0b.save()
	vote0c.save()
#def insert_all_data():
#	insert_all_WeiaaUser()
#	insert_all_WeiaaActivity()
#	insert_all_WeiaaActivityPlan()
#	insert_all_WeiaaActivityPlanItem()
#	insert_all_WeiaaActivityPlanVote()

	